<template>
  <div>
    <div class="Loadinganimation">
      <div class="Loadinganimation-box" v-if="show">
        <img class="loading-gif" src="../assets/8.Loading.gif" alt="" />
      </div>
    </div>
    <div class="MovieTheatre-middle-content">
      <div
        class="MovieTheatre-middle-content-details"
        v-for="item in dataList"
        @click="toMoviesecond(item)"
        :key="item.name"
      >
        <div class="MovieTheatre-middle-content-details-left">
          <span>{{ item.name }}</span>
          <p>{{ item.address }}</p>
        </div>

        <div class="MovieTheatre-middle-content-details-right">
          <span class="MovieTheatre-money">￥</span
          ><span class="MovieTheatre-number">{{ item.lowPrice / 100 }}</span
          ><span class="MovieTheatre-money">起</span>
          <p>距离未知</p>
        </div>
      </div>
    </div>
  </div>
</template>



<script>
import axios from "axios";
export default {
  data() {
    return {
      show: true,
      dataList: [],
    };
  },
  props: ["item"],
  methods: {
    toMoviesecond(item) {
      this.$router.push({
        path: "/Moviesecond",
        query: {
          name: item.name,
          address: item.address,
          // des:item.des
        },
      });
    },
  },

  created() {
    var that = this;
    var url =
      "https://m.maizuo.com/gateway?cityId=110100&ticketFlag=1&k=8427503";
    axios
      .get(url, {
        headers: {
          "X-Host": "mall.film-ticket.cinema.list",
        },
      })
      .then(function (res) {
        // console.log(res.data.data.films);
        console.info(res.data.data.cinemas);

        that.dataList = res.data.data.cinemas;
        that.show = false;
      })
      .catch(function (error) {
        console.log(error);
      });
  },
};
</script>


<style scoped>
/* 加载动画效果 */
.loading-gif {
  width: 60px;
  height: 60px;
  opacity: 0.4;
  border-radius: 10px;
}

.box-box {
  position: relative;
}

.loading-gif {
  position: absolute;
  top: 280px;
  left: 40%;
}
</style>
